import { useQuery } from '@tanstack/react-query';
import { apiClient } from '@/app/lib/api-client';
import type { GetUsersParams } from '@/app/types/api';

export function useUsers(params?: GetUsersParams) {
  return useQuery({
    queryKey: ['users', params],
    queryFn: () => apiClient.getUsers(params)
  });
}

export function useUser(id: string) {
  return useQuery({
    queryKey: ['user', id],
    queryFn: () => apiClient.getUser({ id })
  });
}